/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.altius.dao.impl;

import cc.altius.dao.ServiceDetailsDao;
import cc.altius.model.ServiceDetails;
import java.util.List;
import javax.persistence.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author mudassar
 */
@Repository("ServiceDetailsDao")
public class ServiceDetailsDaoImpl implements ServiceDetailsDao {

    private HibernateTemplate hibernateTemplate;
    private SessionFactory sessionFactory;
    Session session;
    Query query;

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

    @Override
    @Transactional
    public List<ServiceDetails> getListOfServices() {
        return this.hibernateTemplate.find("From ServiceDetails ");
    }
}
